package com.david.andserver

import android.annotation.SuppressLint
import android.app.Activity
import android.os.Bundle
import android.view.View
import android.webkit.WebChromeClient
import android.webkit.WebView
import android.webkit.WebViewClient

class WebQrCodeActivity:Activity() {
    @SuppressLint("SetJavaScriptEnabled")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_web_qrcode)
        findViewById<View>(R.id.back).setOnClickListener { finish() }

        val webView = findViewById<WebView>(R.id.webview)
        webView.settings.javaScriptEnabled = true
        webView.webChromeClient = WebChromeClient()
        webView.webViewClient = WebViewClient()
        webView.loadUrl("file:android_asset/web/qrCreate.html?content=" + intent.getStringExtra("ip") + ":" + NetInfo.PORT);
        //webView.loadUrl("https://load_star.gitee.io/qrcode/qrcode.html?content=" + intent.getStringExtra("ip") + ":" + NetInfo.PORT)
    }
}